<!DOCTYPE html>
<html>    
    <head>
        <#include "/template/common/head.ftl">
    </head>
    
    <body>
		<#include "/template/common/navigator.ftl">
        <div class="container">
            <div class="row">
                <div class="span10">
                    <div id="listing-post-container">
						<#if contents!='null'>
						<#list contents as content>
                        <div class="listing-box">
                            <div class="post-thumbnail">
                                <a href="/content/<#if "${content.url!''}"!="">${content.url}<#else>${content.id}</#if>"
                                rel="bookmark" title="${content.title}">
                                    <img src="${content.litImg!''}" class="attachment-100x100 wp-post-image"
                                    alt="${content.title}" height="100" width="100" onerror="this.src='/images/default.png'">
                                </a>
                            </div>
                            <div class="listing-content">
                                <h2 id="post-13618">
                                    <a href="/content/<#if "${content.url!''}"!="">${content.url}<#else>${content.id}</#if>"
                                    rel="bookmark" title="${content.title}">
                                        ${content.title}
                                    </a>
                                </h2>
                                <div class="listing-post-meta">
                                    By
                                    <a href="/author/${users.get(content.authorId).userCode}" rel="author">
                                        ${users.get(content.authorId).userName}
                                    </a>
                                    - ${content.writeDate?string("yyyy-MM-dd HH:mm:ss")}
                                </div>
                                <p>
                                    ${content.description}
                                    <span class="bluelink">
                                        …
                                        <a href="/content/<#if "${content.url!''}"!="">${content.url}<#else>${content.id}</#if>">
                                            Continue Reading
                                        </a>
										<@showContentManagement contentUrl=content.url contentUserId=content.authorId active=content.active?string contentId=content.id/>
                                    </span>
                                </p>
                                <span class="post-tag">
									<#list "${content.tags}"?split(",") as tag>
									<a href="/tag/${tag}" rel="tag">
                                        ${tag}
                                    </a>&nbsp;
									</#list>
                                </span>
                            </div>
                        </div>
						</#list>
						</#if>
						<!-- /#listing page begin-->
                        <div id="listing-paging">
                            <div class="wp-pagenavi">
								<#if totalPages==0>
									<#assign totalPages=1>
								</#if>
                                <span class="pages">
                                    Page ${page} of ${totalPages}
                                </span>
								<a href="/" class="first">
									« First
                                </a>
								<#if page-1 gt 0>
								<a href="/page/${page-1}" class="previouspostslink">
                                    «
                                </a>
								</#if>
								<#if page-2 gt 0>
									<#if page-2 gt 1>
										<span class='extend'>...</span>
									</#if>
									<#list page-2..page as cPage>
										<#if cPage==page>
										<span class="current">
											${cPage}
										</span>
										<#else>
										<a href="/page/${cPage}" class="page larger">
											${cPage}
										</a>
										</#if>
									</#list>
									<#if page+2 gt totalPages>
										<#list page+1..totalPages as cPage>
											<a href="/page/${cPage}" class="page larger">
											${cPage}
											</a>
										</#list>
									<#else>										
										<#list page+1..page+2 as cPage>
											<a href="/page/${cPage}" class="page larger">
											${cPage}
											</a>
										</#list>
										<span class='extend'>...</span>
									</#if>
								<#else>
									<#list 1..page as cPage>
										<#if cPage==page>
											<span class="current">
												${cPage}
											</span>
										<#else>
											<a href="/page/${cPage}" class="page larger">
												${cPage}
											</a>
										</#if>
									</#list>
									<#if totalPages gt 5>
										<#list page+1..5 as cPage>											
											<a href="/page/${cPage}" class="page larger">
												${cPage}
											</a>											
										</#list>
									<#else>
										<#if page gt totalPages>
											<#list page+1..totalPages as cPage>
												<#if cPage <= totalPages>
												<a href="/page/${cPage}" class="page larger">
													${cPage}
												</a>
												</#if>
											</#list>
										</#if>
									</#if>									
								</#if>
								<#if page < totalPages>
                                <a href="/page/${page+1}" class="nextpostslink">
                                    »
                                </a>
								</#if>
                                <a href="/page/${totalPages}" class="last">
                                    Last »
                                </a>
                            </div>
                        </div>
                    </div>
                    <!-- /#listing-post-container-->
                </div>
                <!--/span10 -->
                <#include "/template/common/right.ftl">
                <!--/.span4 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /container -->
		<#include "/template/common/tail.ftl">

    </body>
    <!-- end of body -->

</html>